/*
package cn.yunhe.insurance.util;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;

import java.io.Serializable;
import java.util.Set;

public class RedisUtil  {
    private RedisTemplate<Serializable,Object> redisTemplate;


*/
/**
 * 是否存在该 key
 *
 * @param key
 * @return
 *//*


    public boolean exists(final String key) {
        return redisTemplate.hasKey(key);
    }


*/
/**
 * 删除 key 对应的值
 *
 * @param key
 * @return
 *//*


    public boolean del(final String key) {
        boolean flag = false;
        if (exists(key)) {
            redisTemplate.delete(key);
            flag = true;
        }
        return flag;
    }


*/
/**
 * 删除多个key
 *
 * @param keys
 *//*


    public void del(final String... keys) {
        for (String key : keys
                ) {
            del(key);
        }
    }


*/
/**
 * 写入缓存
 *
 * @param key
 * @param value
 * @return
 *//*


    public boolean set(final String key, String value) {
        boolean flag = false;
        ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
        try {
            operations.set(key, value);
            flag = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }


*/
/**
 * 写入缓存,带有效时间
 *
 * @param key
 * @param value
 * @param expireTime
 * @return
 *//*


    public boolean set(final String key, String value, Long expireTime) {
        boolean flag = false;
        ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
        try {
            operations.set(key, value, expireTime);
            flag = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }


*/
/**
 * 读取缓存
 *
 * @param key
 * @return
 *//*


    public Object get(final String key) {
        Object value = null;
        ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
        value = operations.get(key);
        return value;
    }


    */
/**
     *
     * @param pattern
     *//*


    public void delPattern(final String pattern){
        Set<Serializable> keys=redisTemplate.keys(pattern);
        if(keys.size()>0){
            redisTemplate.delete(keys);
        }

    }




    public RedisTemplate<Serializable, Object> getRedisTemplate() {
        return redisTemplate;
    }

    public void setRedisTemplate(RedisTemplate<Serializable, Object> redisTemplate) {
        this.redisTemplate = redisTemplate;
    }
}
*/
